package crazyjava;


public class Base {
    protected double size;
    protected String name;

    public Base(double size, String name) {
        this.size = size;
        this.name = name;
    }
}

class Sub extends Base {
    private String color;

    public Sub(double size, String name, String color) {
        //通过super调用来调用父类构造器的初始化过程
        super(size, name);
        this.color = color;
    }

    public static void main(String[] args) {
        Sub a = new Sub(5.6, "测试对象", "红色");
        //输出Sub对象的三个属性
        System.out.println(a.size + "--" + a.name + "--" + a.color);
    }
}